<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #cvs {
            /* 
                默认宽高 ：想要更改，要行内式设置
                width: 300px;
                height: 150px;
            */
            border: 1px solid #f00;
        }
    </style>
</head>

<body>
    <canvas id="cvs" width="1000" height="500"></canvas>
</body>
<script>
    const cvsDom = document.querySelector('#cvs') //获取canvas的元素

    const context = cvsDom.getContext('2d');  //生成canvas绘制元素 


    context.font = '30px sans-serif';  // 设置字体字号

    context.fillStyle = '#f00';    //绘制填充文字

    // context.strokeStyle = '#000';  // 设置颜色 描边

    // context.fillText(text, x, y, maxWidth);
    context.fillText('2106A', 100, 50)


</script>

</html>